Fix a couple of bugs in the key event handling: Now AltGr chars work
authorTor Lillqvist <tml@src.gnome.org>
Thu, 12 Aug 1999 21:44:22 +0000 (21:44 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Thu, 12 Aug 1999 21:44:22 +0000 (21:44 +0000)
* gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
in the key event handling: Now AltGr chars work again. Also,
now Alt-digits are passed up as well as Control-digits.
Pass keypad plus and minus as normal plus and minus.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/win32/gdkevents-win32.c
gdk/win32/gdkevents.c

index 60dbfcca7e7164fd54298a55f53f0c68b39d272d..4f28d8b08df3593ac541114c4bbed0393adb5ae3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1999-08-13  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
+       in the key event handling: Now AltGr chars work again. Also,
+       now Alt-digits are passed up as well as Control-digits.
+       Pass keypad plus and minus as normal plus and minus.
+
 Wed Aug 11 13:38:26 BST 1999 Tony Gale  <gale@gtk.org>
 
         * docs/gtkfaq.sgml: FAQ Update
index 60dbfcca7e7164fd54298a55f53f0c68b39d272d..4f28d8b08df3593ac541114c4bbed0393adb5ae3 100644 (file)
@@ -1,3 +1,10 @@
+1999-08-13  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
+       in the key event handling: Now AltGr chars work again. Also,
+       now Alt-digits are passed up as well as Control-digits.
+       Pass keypad plus and minus as normal plus and minus.
+
 Wed Aug 11 13:38:26 BST 1999 Tony Gale  <gale@gtk.org>
 
         * docs/gtkfaq.sgml: FAQ Update
index 60dbfcca7e7164fd54298a55f53f0c68b39d272d..4f28d8b08df3593ac541114c4bbed0393adb5ae3 100644 (file)
@@ -1,3 +1,10 @@
+1999-08-13  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
+       in the key event handling: Now AltGr chars work again. Also,
+       now Alt-digits are passed up as well as Control-digits.
+       Pass keypad plus and minus as normal plus and minus.
+
 Wed Aug 11 13:38:26 BST 1999 Tony Gale  <gale@gtk.org>
 
         * docs/gtkfaq.sgml: FAQ Update
index 60dbfcca7e7164fd54298a55f53f0c68b39d272d..4f28d8b08df3593ac541114c4bbed0393adb5ae3 100644 (file)
@@ -1,3 +1,10 @@
+1999-08-13  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
+       in the key event handling: Now AltGr chars work again. Also,
+       now Alt-digits are passed up as well as Control-digits.
+       Pass keypad plus and minus as normal plus and minus.
+
 Wed Aug 11 13:38:26 BST 1999 Tony Gale  <gale@gtk.org>
 
         * docs/gtkfaq.sgml: FAQ Update
index 60dbfcca7e7164fd54298a55f53f0c68b39d272d..4f28d8b08df3593ac541114c4bbed0393adb5ae3 100644 (file)
@@ -1,3 +1,10 @@
+1999-08-13  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
+       in the key event handling: Now AltGr chars work again. Also,
+       now Alt-digits are passed up as well as Control-digits.
+       Pass keypad plus and minus as normal plus and minus.
+
 Wed Aug 11 13:38:26 BST 1999 Tony Gale  <gale@gtk.org>
 
         * docs/gtkfaq.sgml: FAQ Update
index 60dbfcca7e7164fd54298a55f53f0c68b39d272d..4f28d8b08df3593ac541114c4bbed0393adb5ae3 100644 (file)
@@ -1,3 +1,10 @@
+1999-08-13  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
+       in the key event handling: Now AltGr chars work again. Also,
+       now Alt-digits are passed up as well as Control-digits.
+       Pass keypad plus and minus as normal plus and minus.
+
 Wed Aug 11 13:38:26 BST 1999 Tony Gale  <gale@gtk.org>
 
         * docs/gtkfaq.sgml: FAQ Update
index 60dbfcca7e7164fd54298a55f53f0c68b39d272d..4f28d8b08df3593ac541114c4bbed0393adb5ae3 100644 (file)
@@ -1,3 +1,10 @@
+1999-08-13  Tor Lillqvist  <tml@iki.fi>
+
+       * gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
+       in the key event handling: Now AltGr chars work again. Also,
+       now Alt-digits are passed up as well as Control-digits.
+       Pass keypad plus and minus as normal plus and minus.
+
 Wed Aug 11 13:38:26 BST 1999 Tony Gale  <gale@gtk.org>
 
         * docs/gtkfaq.sgml: FAQ Update
index d4b5a484609dae8824fc3cc1bb32685b055ce7a0..efe2a29db79dbd3044fb06fb01020897ce7c3af3 100644 (file)
@@ -1488,11 +1488,23 @@ gdk_event_translate (GdkEvent *event,
        case VK_MULTIPLY:
          event->key.keyval = GDK_KP_Multiply; break;
        case VK_ADD:
+#if 0
          event->key.keyval = GDK_KP_Add; break;
+#else
+         /* Pass it on as an ASCII plus in WM_CHAR. */
+         ignore_WM_CHAR = FALSE;
+         break;
+#endif
        case VK_SEPARATOR:
          event->key.keyval = GDK_KP_Separator; break;
        case VK_SUBTRACT:
+#if 0
          event->key.keyval = GDK_KP_Subtract; break;
+#else
+         /* Pass it on as an ASCII minus in WM_CHAR. */
+         ignore_WM_CHAR = FALSE;
+         break;
+#endif
        case VK_DECIMAL:
 #if 0
          event->key.keyval = GDK_KP_Decimal; break;
@@ -1548,8 +1560,9 @@ gdk_event_translate (GdkEvent *event,
        case '7':
        case '8':
        case '9':
-         if (GetKeyState (VK_CONTROL) < 0)
-           /* Control-digits won't come in as a WM_CHAR */
+         if (!is_AltGr_key && (GetKeyState (VK_CONTROL) < 0
+                               || GetKeyState (VK_MENU) < 0))
+           /* Control- or Alt-digits won't come in as a WM_CHAR */
            event->key.keyval = GDK_0 + (xevent->wParam - '0');
          else
            {
@@ -1744,7 +1757,12 @@ gdk_event_translate (GdkEvent *event,
        }
       else
        return_val = FALSE;
+#if 0 /* Don't reset is_AltGr_key here. Othewise we can't type several
+       * AltGr-accessed chars while keeping the AltGr pressed down
+       * all the time.
+       */
       is_AltGr_key = FALSE;
+#endif
       break;
 
     case WM_LBUTTONDOWN:
index d4b5a484609dae8824fc3cc1bb32685b055ce7a0..efe2a29db79dbd3044fb06fb01020897ce7c3af3 100644 (file)
@@ -1488,11 +1488,23 @@ gdk_event_translate (GdkEvent *event,
        case VK_MULTIPLY:
          event->key.keyval = GDK_KP_Multiply; break;
        case VK_ADD:
+#if 0
          event->key.keyval = GDK_KP_Add; break;
+#else
+         /* Pass it on as an ASCII plus in WM_CHAR. */
+         ignore_WM_CHAR = FALSE;
+         break;
+#endif
        case VK_SEPARATOR:
          event->key.keyval = GDK_KP_Separator; break;
        case VK_SUBTRACT:
+#if 0
          event->key.keyval = GDK_KP_Subtract; break;
+#else
+         /* Pass it on as an ASCII minus in WM_CHAR. */
+         ignore_WM_CHAR = FALSE;
+         break;
+#endif
        case VK_DECIMAL:
 #if 0
          event->key.keyval = GDK_KP_Decimal; break;
@@ -1548,8 +1560,9 @@ gdk_event_translate (GdkEvent *event,
        case '7':
        case '8':
        case '9':
-         if (GetKeyState (VK_CONTROL) < 0)
-           /* Control-digits won't come in as a WM_CHAR */
+         if (!is_AltGr_key && (GetKeyState (VK_CONTROL) < 0
+                               || GetKeyState (VK_MENU) < 0))
+           /* Control- or Alt-digits won't come in as a WM_CHAR */
            event->key.keyval = GDK_0 + (xevent->wParam - '0');
          else
            {
@@ -1744,7 +1757,12 @@ gdk_event_translate (GdkEvent *event,
        }
       else
        return_val = FALSE;
+#if 0 /* Don't reset is_AltGr_key here. Othewise we can't type several
+       * AltGr-accessed chars while keeping the AltGr pressed down
+       * all the time.
+       */
       is_AltGr_key = FALSE;
+#endif
       break;
 
     case WM_LBUTTONDOWN: